/**
 * @author gaopeng
 * @date 2019/12/13 11:43 下午
 */
public class Client {
    public static void main(String[] args) {
        //父类构造方法初始化
        AbstractMediator mediator = new Mediator();
        //后赋值模式
        Purchase purchase = new Purchase(mediator);
        mediator.setPurchase(purchase);
        Sale sale = new Sale(mediator);
        mediator.setSale(sale);
        Stock stock = new Stock(mediator);
        mediator.setStock(stock);

        System.out.println("------采购人员采购电脑------");
        purchase.buyComputer(60);
        System.out.println("------销售电脑销售电脑------");
        sale.sellComputer(10);
        System.out.println("------库存管理人员清理库存-------");
        stock.cleanStock();
    }
}
